package com.example.bmysurprisemeal.service;

import com.example.bmysurprisemeal.model.Restaurant;
import com.example.bmysurprisemeal.repository.RestaurantRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RestaurantService {

    @Autowired
    private RestaurantRepository restaurantRepository;

    public Restaurant addRestaurant(Restaurant restaurant) {
        return restaurantRepository.save(restaurant);
    }

    public Restaurant findByName(String name) {
        return restaurantRepository.findByName(name);
    }
}